﻿
<template>
<div class="card-fill layout-padding">
<el-card shadow="hover" class="layout-padding-auto" >
  <el-form ref="formRefBatchCompilations" :model="stateBatchCompilations.vmModel" label-width="100px">
    <el-row>
      
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_factoryCode_FormItem" prop="Entity.factoryCode" label="工厂编码">
            <el-input v-model="stateBatchCompilations.vmModel.Entity.factoryCode" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_lineCode_FormItem" prop="Entity.lineCode" label="产线编码">
            <el-input v-model="stateBatchCompilations.vmModel.Entity.lineCode" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_stationCode_FormItem" prop="Entity.stationCode" label="工位编码">
            <el-input v-model="stateBatchCompilations.vmModel.Entity.stationCode" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_orderCode_FormItem" prop="Entity.orderCode" label="所属工单">
            <el-input v-model="stateBatchCompilations.vmModel.Entity.orderCode" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_scheduleCode_FormItem" prop="Entity.scheduleCode" label="所属排程">
            <el-input v-model="stateBatchCompilations.vmModel.Entity.scheduleCode" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_materialCode_FormItem" prop="Entity.materialCode" label="物料编码">
            <el-input v-model="stateBatchCompilations.vmModel.Entity.materialCode" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_materialName_FormItem" prop="Entity.materialName" label="物料名称">
            <el-input v-model="stateBatchCompilations.vmModel.Entity.materialName" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_batchCode_FormItem" prop="Entity.batchCode" label="批次号">
            <el-input v-model="stateBatchCompilations.vmModel.Entity.batchCode" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_batchSingleCostQty_FormItem" prop="Entity.batchSingleCostQty" label="批次料单次消耗量">
            <el-input v-model="stateBatchCompilations.vmModel.Entity.batchSingleCostQty" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_batchAddQty_FormItem" prop="Entity.batchAddQty" label="批次料添加量">
            <el-input v-model="stateBatchCompilations.vmModel.Entity.batchAddQty" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_batchMarginQty_FormItem" prop="Entity.batchMarginQty" label="批次料余量">
            <el-input v-model="stateBatchCompilations.vmModel.Entity.batchMarginQty" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_isUse_FormItem" prop="Entity.isUse" label="是否启用" :rules="[{ required: true, message:'是否启用为必填项',trigger:'blur'}]">
            <el-select v-model="stateBatchCompilations.vmModel.Entity.isUse" disabled clearable>
                <el-option :key="1" :value=true :label="$t('message._system.common.vm.tips_bool_true')"></el-option>
                <el-option :key="0" :value=false :label="$t('message._system.common.vm.tips_bool_false')"></el-option>
                </el-select>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_Filed1_FormItem" prop="Entity.Filed1" label="预留域1">
            <el-input v-model="stateBatchCompilations.vmModel.Entity.Filed1" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    <el-col :xs="24" :lg="12" class="mb20">
        <el-form-item ref="Entity_Filed2_FormItem" prop="Entity.Filed2" label="预留域2">
            <el-input v-model="stateBatchCompilations.vmModel.Entity.Filed2" disabled clearable></el-input>
        </el-form-item>
    </el-col>
    </el-row>

    <div style="text-align:right;">
      <WtmButton @click="onCloseBatchCompilations"  type="primary" :button-text="$t('message._system.common.vm.cancel')" style="margin-top:15px;"/>
    </div>
  </el-form>

</el-card>
</div>
</template>


<script setup lang="ts" name="message._system.common.vm.detail;false">
import {  ElMessageBox, ElMessage } from 'element-plus';
import { defineAsyncComponent,reactive, ref, getCurrentInstance, onMounted, nextTick } from 'vue';
import { BatchCompilationsApi } from '/@/api/baseinformation/BatchCompilations';
import other from '/@/utils/other';
import fileApi from '/@/api/file';
import { useRouter } from "vue-router";
const ci = getCurrentInstance() as any;

// 定义变量内容
const formRefBatchCompilations = ref();
const stateBatchCompilations = reactive({
      vmModel: {
	  Entity:{
      			ID: null,
			factoryCode: null,
			lineCode: null,
			stationCode: null,
			orderCode: null,
			scheduleCode: null,
			materialCode: null,
			materialName: null,
			batchCode: null,
			batchSingleCostQty: null,
			batchAddQty: null,
			batchMarginQty: null,
			isUse: null,
			Filed1: null,
			Filed2: null,

      },
      
	},
    
     
});

// 取消
const onCloseBatchCompilations = () => {
    closeDialog();
};


// 页面加载时
onMounted(() => {
    
     if (ci.attrs["wtmdata"]) {
		stateBatchCompilations.vmModel.Entity.ID = ci.attrs["wtmdata"].ID;
	}
	else if (useRouter().currentRoute.value.query.id) {
		stateBatchCompilations.vmModel.Entity.ID = useRouter().currentRoute.value.query.id as any;
	}
	BatchCompilationsApi().get(stateBatchCompilations.vmModel.Entity.ID ?? "").then((data: any) => other.setValue(stateBatchCompilations.vmModel, data));
});

// 定义子组件向父组件传值/事件
const emit = defineEmits(['refresh','closeDialog']);
// 关闭弹窗
const closeDialog = () => {
    emit('closeDialog');
};
// 暴露变量
defineExpose({

});
</script>

<style scoped lang="scss">

</style>

